package org.example.car.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import org.example.car.system.domain.Role;
import org.example.car.system.domain.SysRole;
import org.example.car.system.mapper.SysRoleMapper;
import org.example.car.system.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86156
* @description 针对表【SYS_ROLE】的数据库操作Service实现
* @createDate 2024-06-21 15:16:22
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole>
    implements SysRoleService {

    @Autowired
    SysRoleMapper sysRoleMapper;
//    @Override
//    public List<SysRole> selectAll() {
//        return sysRoleMapper.selectAll();
//    }

    @Override
    public PageInfo<SysRole> selectAlls(SysRole sysRole) {
        PageHelper.startPage(sysRole.getPageNum(),sysRole.getPageSize());
        List<SysRole> list = sysRoleMapper.selectAlls(sysRole);
        return new PageInfo<>(list);
    }

    @Override
    public void sevaBatch(List<SysRole> lists) {
        sysRoleMapper.sevaBatch(lists);
    }

    @Override
    public void saves(SysRole sysRole) {
        sysRoleMapper.saves(sysRole);
    }

    @Override
    public void updates(SysRole sysRole) {
        sysRoleMapper.updates(sysRole);
    }

    @Override
    public void updateRs(Integer id) {
        sysRoleMapper.updateRs(id);
    }

    @Override
    public List<SysRole> selectAll() {
        return sysRoleMapper.selectAll();
    }
}




